<?php


namespace app\api\controller;


use app\service\model\VoucherModel;
use app\service\Y;

class Voucher extends AuthApi
{

    /**
     * 获取抵扣券
     * @return \think\response\Json
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function get_voucher(): \think\response\Json
    {
        $data = VoucherModel::where('member_id', '=', $this->member->id)->where('status', '=', 1)->find();
        return Y::success($data, '抵扣券');
    }
}